package org.iac;

import org.iac.model.map.MyItemizedOverlay;

import android.graphics.drawable.Drawable;
import android.os.Bundle;

import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;
import com.google.android.maps.MyLocationOverlay;
import com.google.android.maps.OverlayItem;

public class InsatMapActivity extends MapActivity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.mapvies);
		
		MapView mapView = (MapView) findViewById(R.id.mapview);
		
		//activer button zoom
	    mapView.setBuiltInZoomControls(true);
	    
	    //image qui va indiquer la position de l'insat
	    Drawable drawable = getResources().getDrawable(R.drawable.marque);
	    
	    //ajout de l emplacement de l insat sur la mapview
	    MyItemizedOverlay itemizedoverlay = new MyItemizedOverlay(drawable, this);
	    
	    GeoPoint point = new GeoPoint(36843113,10196941);
	    OverlayItem overlayitem = new OverlayItem(point, "Insat", "I'am INSAT");
	    
	    itemizedoverlay.addOverlay(overlayitem);
	    mapView.getOverlays().add(itemizedoverlay);
	    
	    
	    //centrer mapview sur l insat
	    mapView.getController().animateTo(point);
	    
	    //regler niveau de zoom par defaut 
	    mapView.getController().setZoom(10);
	    
	    
	  
	}

	@Override
	protected boolean isRouteDisplayed() {
		// TODO Auto-generated method stub
		return false;
	}

}
